wayland: Don't leak the tmp_keymap
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 5 Sep 2014 21:31:44 +0000 (14:31 -0700)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 5 Sep 2014 22:06:19 +0000 (15:06 -0700)
This is a static variable, so setting it every time will leak the
previous one.

gdk/wayland/gdkdisplay-wayland.c

index dea982acd761ce47d2b542f287103df6dbbb015a..20d63bb687784dcb3635597884c1eeb9452df942 100644 (file)
@@ -534,7 +534,8 @@ _gdk_wayland_display_get_keymap (GdkDisplay *display)
   if (core_keyboard)
     return _gdk_wayland_device_get_keymap (core_keyboard);
 
-  tmp_keymap = _gdk_wayland_keymap_new ();
+  if (!tmp_keymap)
+    tmp_keymap = _gdk_wayland_keymap_new ();
 
   return tmp_keymap;
 }